module.exports = {
    devServer:{
        proxy:{
            '/filorga-wechat':{
                target:'http://www.cindure.com'
            }
        }
    },
    chainWebpack(config) {
        config
            .when(process.env.NODE_ENV === 'production', config => {
                config
                    .output
                    .publicPath(process.env.NODE_ENV === 'production' ? '/filorga-wechat/static/dist/' : '/')
                    .end()
                    .plugin('html')
                    .tap(args => {
                        args[0].filename = 'home2.jsp';
                        args[0].jspHead = '<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>';
                        args[0].injectScript = "<script>window.data={uid:'${uid}',name:'${name}',sid:'${sid}',phone:'${phone}',type:${type},imgurl:'${imgurl}'}</script>";
                        return args;
                    }).end();
            }, config => {
                config
                    .plugin('html')
                    .tap(args => {
                        args[0].injectScript = '<script>window.data={"uid":"5b025fdde4b05259575bbbd8","name":"赵立扬","sid":"5ac19f35e5a6e6cf12e7f515","phone":"18904979689","type":1,"imgurl":"../assets/logo.png"}</script>';
                        return args;
                    })
                    .end();
            });
    }
}